package com.agent.platform.config;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 监控指标配置
 */
@Configuration
public class MetricsConfig {
    
    @Bean
    public Counter taskCreatedCounter(MeterRegistry registry) {
        return Counter.builder("task.created")
                .description("任务创建总数")
                .register(registry);
    }
    
    @Bean
    public Counter taskSuccessCounter(MeterRegistry registry) {
        return Counter.builder("task.success")
                .description("任务成功总数")
                .register(registry);
    }
    
    @Bean
    public Counter taskFailedCounter(MeterRegistry registry) {
        return Counter.builder("task.failed")
                .description("任务失败总数")
                .register(registry);
    }
    
    @Bean
    public Timer taskExecutionTimer(MeterRegistry registry) {
        return Timer.builder("task.execution.time")
                .description("任务执行时间")
                .register(registry);
    }
}
